﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tp.Base {

    public class MyEventHandler {

        #region Members

        public event EventHandler Changed;
        public event EventHandler AfterSelected;

        #endregion

        #region Methods

        protected virtual void OnChanged(object sender, EventArgs e) {
            EventHandler changed = Changed;
            if (changed != null) {
                changed(this, e);
            }
        }

        protected virtual void OnSelected(object sender, EventArgs e) {
            EventHandler selected = AfterSelected;
            if (selected != null) {
                selected(this, e);
            }
        }

        public void ChangeSelect(object sender, EventArgs e) {
            Changed(sender, e);
        }

        public void SelectChanged(object sender, EventArgs e) {
            AfterSelected(sender, e);
        }

        #endregion

    }
}
